// import CardStackStyleInterpolator from 'react-navigation/src/views/CardStackStyleInterpolator';
import {createStackNavigator, createBottomTabNavigator, createAppContainer} from "react-navigation"

// import {PageAutoLogin, PageQr, PageFastImage, PageImagePicker} from "./PageTest"
import { PageAutoLogin } from "./PageAutoLogin"
import { PageLogin } from "./PageLogin"
import { Homes } from "./home/Homes"
import { History } from "./home/History"
import { Search } from "./home/Search"
import { Apps } from "./home/Apps"
import { PageSign } from "./PageSign"
import { PageKefu } from "./PageKefu"
// import { HotCake } from "./home/HotCake"
import { Major } from "./home/Major"
import { GoodsDetail } from "./home/GoodsDetail"
import { ShareTo } from "./home/ShareTo"

import { PageMsg } from "./PageMsg"
import { PageVip } from "./PageVip"
import { PageVipPay } from "./PageVipPay"
import { PageMoments } from "./PageMoments"
// import { PageWeb } from "./PageWeb"
import { Me } from "./me/Me"
import { Info } from "./me/Info"
import { Cash } from "./me/Cash"
import { CashRecord } from "./me/CashRecord"
import { Team } from "./me/Team"
import { TeamDetail } from "./me/TeamDetail"
import { Promote } from "./me/Promote"
import { Favorite } from "./me/Favorite"
import { Profit } from "./me/Profit"
import { Order } from "./me/Order"
import { Spread } from "./me/Spread"
import { Questions, Question, Contact } from "./me/Question"
import { Tutorial } from "./me/Tutorial"


import { Nav } from "./_utils"
import { ApplyNavigatorObject } from "./apply/_applyNavigatorObject"

// 切换到对应的界面才会开始初始化(废话,想卡死么)
const bottomTabNavigator = createBottomTabNavigator({
    Homes : {screen:Homes, navigationOptions:{title:"首页"}},
    PageMsg : {screen:PageMsg, navigationOptions:{title:"消息"}},
    PageVip : {screen:PageVip, navigationOptions:{title:"会员中心"}},
    PageMoments : {screen:PageMoments, navigationOptions:{title:"朋友圈"}},
    PageMe : {screen:Me, navigationOptions:{title:"我"}},
}, {
    initialRouteName: "Homes",
    tabBarOptions:Nav.tabBarOptions,
})

const StackNavigator = createStackNavigator({
    PageAutoLogin,
    // PageQr,
    // PageFastImage,
    // PageImagePicker,
    PageLogin,
    // PageWeb,
    PageMain : {screen:bottomTabNavigator, navigationOptions:{header:null}},
    // Home
    History,
    Search,
    Apps,
    PageSign,
    PageKefu,
    // HotCake,
    Major,
    GoodsDetail,
    ShareTo,
    // Vip
    // PageVip : {screen:PageVip, navigationOptions:{header:null}},
    PageVipPay,
    // Me
    Info,
    Cash,
    CashRecord,
    Team,
    TeamDetail,
    Promote,
    Favorite,
    Profit,
    Order,
    Spread,
    Questions,
    Question,
    Contact,
    Tutorial,
    // 
    ...ApplyNavigatorObject,
}, {
    initialRouteName: "PageAutoLogin",
    // initialRouteName: "PageAutoLogin",
    // initialRouteName: "PageHome_Sign",
    transitionConfig : ()=>({
        isModal : true, 
        // screenInterpolator:CardStackStyleInterpolator.forHorizontal,
    }),
    // headerMode : "none",
    headerBackTitleVisible : false, // ios默认back
    headerLayoutPreset:"center", // 安卓默认左边
    defaultNavigationOptions: Nav.options,
});


export const StackNavigatorContainer = createAppContainer(StackNavigator);